package model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@SuppressWarnings("serial")
@Embeddable
public class ChiTietNXB_SachID implements Serializable {
	private int idSach;
	private int idNXB;

	public ChiTietNXB_SachID(int idSach, int idNXB) {
		super();
		this.idSach = idSach;
		this.idNXB = idNXB;
	}
	public ChiTietNXB_SachID() {
	}

	@Column(name = "ID_Sach", nullable = false)
	public int getidSach() {
		return idSach;
	}

	public void setidSach(int idSach) {
		this.idSach = idSach;
	}

	@Column(name = "ID_NXB", nullable =  false)
	public int getidNXB() {
		return idNXB;
	}

	public void setidNXB(int idNXB) {
		this.idNXB = idNXB;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + idSach;
		result = prime * result + idNXB;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ChiTietNXB_SachID other = (ChiTietNXB_SachID) obj;
		if (idSach != other.idSach)
			return false;
		if (idNXB != other.idNXB)
			return false;
		return true;
	}
	
}
